<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <!-- <a-button  @click="SubmitReturn " type="primary" icon="audit" >错误明细下载</a-button> -->
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
        <a slot="action" slot-scope="text" href="javascript:;">action</a>
      </a-table>
    </div>

  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import {getAction, httpAction,downFile} from '@/api/manage'
  import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
  import { mapGetters } from 'vuex'

  export default {
    name: 'ReportStatusList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      JSelectDepart,
    },
    data () {
      return {
        description: '反馈报文明细管理页面',
        disableMixinCreated:true,
        // 表头
        columns: [
          {
            title: '选项',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          /*{
            title:'数据日期',
            align:"center",
            dataIndex: 'sjrq',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },*/
          {
            title:'补录表英文',
            align:"center",
            dataIndex: 'reportCode'
          },
          {
            title:'补录表中文',
            align:"center",
            dataIndex: 'reportName'
          },
          {
            title:'补录字段英文',
            align:"center",
            dataIndex: 'reportField'
          },
          {
            title:'补录字段中文',
            align:"center",
            dataIndex: 'reportFieldName'
          },
          {
            title:'报文表英文',
            align:"center",
            dataIndex: 'mesTableCode'
          },
          {
            title:'报文表中文',
            align:"center",
            dataIndex: 'messageName'
          },
          {
            title:'报文字段英文',
            align:"center",
            dataIndex: 'fieldCode'
          },
          {
            title:'报文字段中文',
            align:"center",
            dataIndex: 'fieldName'
          },
          {
            title:'错误结果代码',
            align:"center",
            dataIndex: 'errorCode'
          },
          {
            title:'错误结果描述',
            align:"center",
            dataIndex: 'errorName'
          },
          {
            title:'错误报文表主键ID',
            align:"center",
            dataIndex: 'mesKeyId'
          },
          /*{
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }*/
        ],
        url: {
          list: "/feedbackMessage/llbbFeedbackMessage/detailList",
        },
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      
    },
    methods: {
      show (record) {
        this.visible=true;
        this.queryParam.mesId = record.id;
        this.loadData();
      },
      handleOk(){
      },
      handleCancel(){
        
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'mesId',text:'反馈报文ID'})
        fieldList.push({type:'string',value:'errorCode',text:'错误结果代码'})
        fieldList.push({type:'string',value:'errorName',text:'错误结果描述'})
        fieldList.push({type:'string',value:'fieldCode',text:'错误字段代码'})
        fieldList.push({type:'string',value:'fieldName',text:'错误字段描述'})
        fieldList.push({type:'string',value:'mesTableCode',text:'错误报文表表名'})
        fieldList.push({type:'string',value:'mesKeyId',text:'错误报文表主键ID'})
        fieldList.push({type:'string',value:'sjrq',text:'数据日期'})
        this.superFieldList = fieldList
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>